reset
set term windows
set datafile separator ","
load "style.gnu"
set size 1,1
set key right
set yrange [0:100]
set xrange [0:60]
set xtics 0,5,60
set ylabel "Infiltration Height/mm"
set xlabel "Infiltration time/s"
set key bottom right
f(x)=a*sqrt(x)
a=0.8
fit f(x) "17kpa.txt" u 1:2 via a
b=a
f(x)=a*sqrt(x)
a=0.8
fit f(x) "10kpa.txt" u 1:2 via a
plot "17kpa.txt" u 1:2 w p ls 3 t "17kPa",\
"10kpa.txt" u 1:2 w p ls 2 t "10kPa",\
b*sqrt(x) w l ls 3 t "Fitting curve for 17kPa",\
a*sqrt(x) w l ls 2 t "Fitting curve for 10kPa"
strn2=sprintf("17kPa: %5.1f *sqrt(x)", b)
strn3=sprintf("10kPa: %5.1f *sqrt(x)", a)
set label strn2 at 5,80
set label strn3 at 5,70
#set terminal postscript eps enhanced color font 'Helvetica,22'
set term pdf size 4in,3in enhanced font 'Verdana,10'
set output 'p111fig0402.pdf'
replot
unset output